import request from "@/utils/request.js";

// 获取城市下拉
export function getCityList() {
	return request.get("system/city/list");
}

// 获取公益援助看板
export function getAdviserListHelpKanban() {
	return request.get("api/adviser/help-kanban");
}
// 获取公益咨询师列表
export function getAdviserList() {
	return request.get("api/adviser/list");
}
// 获取咨询师详情
export function getUserInfo(id) {
	return request.get("api/order/user-info?userId=" + id);
}

// 清除未读消息
export function chatEliminate(data) {
	return request.post("api/chat/chat-eliminate", data);
}

// 获取聊天列表
export function chatList(data) {
	return request.get("api/chat/chatList?status=" + data);
}
//咨询师入住
export function adviserAdd(data) {
	return request.post("api/adviser/add-user", data);
}

//消息列表
export function chatSlist(data) {
	return request.get("api/chat/get-chat-list", data);
}
//意见反馈
export function feedback(data) {
	return request.post("api/message/add", data);
}


// 我的钱包
export function getMyWallet(end, pageSize, pageNum) {
	return request.get("api/wallet/myWallet?end=" + end + "&pageSize=" + pageSize + "&pageNum=" + pageNum);
}

// 关于我们通用
export function AboutUs(data) {
	return request.get("api/message/get-about", data);
}

// 帮助我们
export function helpCenter(data) {
	return request.get("api/message/get-help", data);
}

// 心理测试通用查询list
export function testList(data) {
	// TODO 以后删除这个 if 判断逻辑
	if(data.isRecommend && data.isRecommend == "1") {
		data.pageSize = 50;
	}
	return request.get("api/questionTopic/list", data);
}

// 心理测试详情查询
export function testInfo(data) {
	return request.get("api/questionTopic/info/" + data);
}

// 心理测试详情查询
export function getTopicInfo(data) {
	return request.get("api/questionTopic/topic-com-list", data);
}

// 心理测试下单
export function createTestOrder(data) {
	return request.post("api/questionTopic/add", data);
}

// 心理测试答案 
// -----old
// export function getAnswer(data) {
// 	return request.get("api/questionTopic/answer-info", data);
// }
export function getAnswer(data) {
	console.log("getAnswer: send data", data)
	return request.post("api/questionTopic/answer-info", data);
}

// 测试评价
export function testEvaluate(data) {
	return request.post("api/questionTopic/add-evaluate", data);
}

// 新建用户测试记录
export function addTestLog(data) {
	return request.post("api/questionTopic/add-log", data);
}

// 字典值通用查询list
export function dictApi(data) {
	return request.get("api/dict/list", data);
}

// 问答发布
export function addQuestion(data) {
	return request.post("api/question/addQuestion",data);
}

// 问答回复
export function addAnswer(data) {
	return request.post("api/question/addAnswer",data);
}

// 公益救助
export function publicAssistanceCall(data) {
	return request.get("api/matter/publicAssistanceCall",data);
}
